import request from '@/utils/request'

// api地址
const api = {
  list: '/v1/comment/list',
  listRows: '/v1/comment/list',
  total: '/v1/comment/stat'
}

// 商品评价列表
export const list = (goods_id, param, option) => {
  return request.get(api.list, { ...param, goods_id }, option)
}

// 商品评价列表 (限制数量, 用于商品详情页展示)
export const listRows = (goods_id, page_size = 5) => {
  return request.get(api.listRows, { goods_id, page_size })
}

// 商品评分总数
export const total = (goods_id) => {
  return request.get(api.total, { goods_id })
}
